Method and system for synchronizing a server and an on-demand database service

ABSTRACT

In accordance with embodiments, there are provided mechanisms and methods for synchronizing a server and an on-demand database service. These mechanisms and methods for synchronizing a server and an on-demand database service can enable embodiments to synchronize a larger amount of data. The ability of embodiments to provide such feature can enable more effective synchronization of a user-level sharing entity database with a multi-user on-demand database service.

CLAIM OF PRIORITY

This application claims the benefit of U.S. Provisional PatentApplication 60/827,874 entitled “Method And System For ContinuouslySynchronizing Data Between An Entity With User-Level Sharing Access AndAn On-Demand Database Service,” by Salmon et al., filed Oct. 2, 2006,the entire contents of which are incorporated herein by reference.

COPYRIGHT NOTICE

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patent documentor the patent disclosure, as it appears in the Patent and TrademarkOffice patent file or records, but otherwise reserves all copyrightrights whatsoever.

FIELD OF THE INVENTION

The current invention relates generally to synchronizing data in adatabase network system.

BACKGROUND

The subject matter discussed in the background section should not beassumed to be prior art merely as a result of its mention in thebackground section. Similarly, a problem mentioned in the backgroundsection or associated with the subject matter of the background sectionshould not be assumed to have been previously recognized in the priorart. The subject matter in the background section merely representsdifferent approaches, which in and of themselves may also be inventions.

In conventional database systems, users access their data resources inone logical database. A user of such a conventional system typicallyretrieves data from and stores data on the system using the user's ownsystems. A user system might remotely access one of a plurality ofserver systems that might in turn access the database system. Dataretrieval from the system might include the issuance of a query from theuser system to die database system. The database system might processthe request for information received in the query and send to the usersystem information relevant to the request.

It is often necessary to synchronize data in such database systems. Asthe amount of data stored by a database system increases, so does theamount of processing, bandwidth, etc. that is required for synchronizingthe same between different databases. There is thus a need foraddressing these and/or other issues.

BRIEF SUMMARY

In accordance with embodiments, there are provided mechanisms andmethods for synchronizing a server and an on-demand database service.These mechanisms and methods for syncrhonizing a server and an on-demanddatabase service can enable embodiments to synchronize a larger amountof data. The ability of embodiments to provide such feature can enablemore effective synchronization of a user-level sharing entity databasewith a multi-user on-demand database service.

In an embodiment and by way of example, a method for synchronizing aserver and an on-demand database service is provided. The methodembodiment includes determining a difference between data stored on afirst server and by an on-demand database service, utilizing a datastructure stored on a computer readable medium. Such data structureincludes a plurality of user identifiers each identifying one of aplurality of users of the on-demand database service. The data structurefurther includes a plurality of data identifiers that are eachcorrelated with at least one of the user identifiers. Such dataidentifiers are adapted for identifying data accessible to the userassociated with the correlated user identifier. In use, the first serverand the on-demand database service may thus be synchronized, based onthe aforementioned difference.

While the present invention is described with reference to an embodimentin which techniques for synchronizing a server and an on-demand databaseservice are implemented in a system having an application serverproviding a front end for an on-demand database service capable ofsupporting multiple tenants, the present invention is not limited tomulti-tenant databases nor deployment on application servers.Embodiments may be practiced using other database architectures, i.e.,ORACLE®, DB2® by IBM and the like without departing from the scope ofthe embodiments claimed.

Any of the above embodiments may be used alone or together with oneanother in any combination. Inventions encompassed within thisspecification may also include embodiments that are only partiallymentioned or alluded to or are not mentioned or alluded to at all inthis brief summary or in the abstract. Although various embodiments ofthe invention may have been motivated by various deficiencies with theprior art, which may be discussed or alluded to in one or more places inthe specification, the embodiments of the invention do not necessarilyaddress any of these deficiencies. In other words, different embodimentsof the invention may address different deficiencies that may bediscussed in the specification. Some embodiments may only partiallyaddress some deficiencies or just one deficiency that may be discussedin the specification, and some embodiments may not address any of thesedeficiencies.

BRIEF DESCRIPTION OF THE DRAWINGS

In the following drawings like reference numbers are used to refer tolike elements. Although the following figures depict various examples ofthe invention, the invention is not limited to the examples depicted inthe figures.

FIG. 1 illustrates a method for synchronizing a server and an on-demanddatabase service, in accordance with one embodiment.

FIG. 2 shows a data structure for synchronizing a server and anon-demand database service, in accordance with one embodiment.

FIG. 3 shows a system for synchronizing a server and an on-demanddatabase service, in accordance with another embodiment.

FIG. 4 illustrates a method for initiating the synchronization of aserver and an on-demand database service, in accordance with anotherembodiment.

FIG. 5 illustrates a method for preparing a slave server for asynchronization process, in accordance with another embodiment.

FIG. 6 illustrates a method for synchronizing an on-demand databaseservice, in accordance with another embodiment.

FIG. 7 illustrates a block diagram of an example of an environmentwherein an on-demand database service might be used.

FIG. 8 illustrates a block diagram of an embodiment of elements of FIG.7 and various possible interconnections between these elements.

DETAILED DESCRIPTION

General Overview

Systems and methods are provided for synchronizing a server and anon-demand database service.

Any attempt to synchronize a user-level sharing entity server and amulti-user on-demand database service poses various challenges. Forexample, if the user-level sharing entity server is permitted todirectly query the multi-user on-demand database service in anunfettered manner, it is possible that such multi-user on-demanddatabase service may be overrun with queries, etc. These mechanisms andmethods for synchronizing a server and an on-demand database service canenable embodiments to synchronize a larger amount of data. As will soonbecome apparent, this may be accomplished utilizing a particular datastructure that enables different users to be correlated with specificdata.

To this end, a subset of data may be synchronized, without necessarilyrequiring synchronization of a larger set of data (which would requireexcessive resources). The ability of embodiments to provide such featurecan enable more effective synchronization of a user-level sharing entityserver with a multi-user on-demand database service. Next, mechanismsand methods for providing synchronizing a server and an on-demanddatabase service will be described with reference to exampleembodiments.

FIG. 1 illustrates a method 100 for synchronizing a server and anon-demand database service, in accordance with one embodiment. In oneembodiment, the aforementioned on-demand database service may include amulti-tenant database system. As used herein, the term multi-tenantdatabase system refers to those systems in which various elements ofhardware and software of the database system may be shared by one ormore customers. For example, a given application server maysimultaneously process requests for a great number of customers, and agiven database table may store rows for a potentially much greaternumber of customers.

As shown in operation 102, a difference is determined between datastored on a first server and by an on-demand database service. In thecontext of the present description, the server may include any computerand/or device that is coupled to the on-demand database service via anetwork. In one possible embodiment, the server may include a user-levelsharing entity in the form of one or more mail servers. Such mailservers may store various information including, but not limited tocontact information, mail, calendar information, and/or any other data,for that matter. One exemplary mail server may include the MICROSOFT®EXCHANGE® server.

Further, the aforementioned difference may be determined in any desiredmanner. For example, a simple comparison may be performed to identifyany disparity, etc. Further, more sophisticated techniques (e.g.hashing, indexing, etc.) may be used for reducing the processingrequired to determine the difference, etc.

In one embodiment, the difference may be determined utilizing a datastructure stored on a computer readable medium. In various embodiments,the computer readable medium may or may not be a component of theaforementioned server, on-demand database service, and/or a separateserver, etc. In any case, the data structure includes a plurality ofuser identifiers each identifying one of a plurality of users of theon-demand database service and a plurality of data identifiers eachcorrelated with at least one of the user identifiers. Such dataidentifiers are adapted for identifying data accessible to the userassociated with the correlated user identifier. Additional detailsassociated with an exemplary data structure will be set forthhereinafter during the description of a different embodiment illustratedin FIG. 2.

In use, the first server and the on-demand database service aresynchronized, based on the difference. See operation 104. By using theforegoing data structure to determine which data is visible to whichuser, the method 100 may afford a more effective way of synchronizingthe first server and the on-demand database service. For example,instead of permitting a user-level sharing entity server to directlyquery a multi-user on-demand database service in an unfettered manner,an intermediate system may use the aforementioned data structure tomanage the synchronization between the user-level sharing entity serverand the multi-user on-demand database service.

More illustrative information will now be set forth regarding variousoptional architectures and features with which the foregoing frameworkmay or may not be implemented, per the desires of the user. It should bestrongly noted that the following information is set forth forillustrative purposes and should not be construed as limiting in anymanner. Any of the following features may be optionally incorporatedwith or without the exclusion of other features described.

FIG. 2 shows a data structure 200 for synchronizing a server and anon-demand database service, in accordance with one embodiment. As anoption, the present data structure 200 may be used to carry out themethod 100 of FIG. 1, for example. Of course, however, the datastructure 200 may be used in any desired environment. It should also benoted that the aforementioned definitions may apply during the presentdescription.

As shown, the data structure 200 includes a plurality of useridentifiers 202 each identifying one of a plurality of users of anon-demand database service. Further included is a plurality of dataidentifiers 204 each correlated with at least one of the useridentifiers 202. Such data identifiers 204 are adapted for identifyingdata accessible to the user associated with the correlated useridentifier. Specifically, the data identifiers 204 may each point toanother data structure 206 that correlates the data identifiers 204 withdata entries 208 including the aforementioned corresponding data, asshown.

In one embodiment, the data structures 200, 206 may each include atable. Of course, the data structures 200, 206 may take other forms inthe context of different embodiments. In any case, the data structures200, 206 are used in conjunction for accessing the data using the useridentifiers. While two data structures 200, 206 are shown, it should benoted that additional data structures (not shown) may be used to pointto further organized data, etc.

By correlating the user identifiers 202 and the data identifiers 204 inthe foregoing manner, the data structure 200 is capable of being used tocontrol access to the data on a user-by-user basis. In particular, byassociating users with corresponding data which is accessible to suchuser, data may be more effectively accessed and operated upon for eachuser (or group of users).

For example, if a group of users is defined by users_1-100 (out of 10Kusers in a multi-tenant system) and synchronization of data accessibleto the group is desired, the data structure 200 may be used toeffectively identify the data to be subjected to the synchronization.Specifically, the user identifiers 202 associated with users_1-100 maybe used to conveniently identify the corresponding data identifiers 204and data entries 208.

FIG. 3 illustrates a system 300 for synchronizing a server and anon-demand database service, in accordance with another embodiment. As anoption, the present system 300 may be used to implement the method 100of FIG. 1 using the data structure 200 of FIG. 2, for example. Ofcourse, however, the system 300 may be used in any desired environment.Again, the aforementioned definitions may apply during the presentdescription.

As shown, an on-demand database service 302 remains in datacommunication with one or more first servers 304 via a plurality ofintermediate components. Such components include a plurality of slaveservers 306 that are each in data communication with the first servers304. In one embodiment, each of the slave servers 306 is allocated to adifferent subset of the users of the first servers 304. Further, thefirst servers 304 and the slave servers 306 may communicate utilizing acollaborative authoring protocol. One exemplary collaborative authoringprotocol may include the World Wide Web distributed authoring andversioning (WebDAV) protocol.

Further included is a master server 308 that is in data communicationwith the on-demand database service 302. In one embodiment, the masterserver 308 may communicate with the on-demand database service 302 via aweb service. As a further option, the master server 308 may be equippedwith the ability to disable any one or more of the slave servers 306.

Also provided is a database server 310 that is coupled between the slaveservers 306 and the master server 308 for allowing data communicationtherebetween. In one embodiment, the database server 310 may include acomputer readable medium with a data structure stored thereon that maybe used for synchronizing data stored on the one or more first servers304 and by the on-demand database service 302. As an option, such datastructure may include the data structure 200 of FIG. 2, for example. Ofcourse, other embodiments are contemplated where such data structure isstored in other locations.

In use, the first servers 304 may communicate data to be synchronized tothe appropriately allocated slave servers 306. Such data may be storedon the first servers 304 and be the subject of various modifications(e.g. addition, changes, deletions, etc.) performed by the users of thefirst servers 304. Similarly, the on-demand database service 302 maycommunicate data to be synchronized to the master server 308. Again,such data may be stored by the on-demand database service 302 and be thesubject of various modifications (e.g. addition, changes, deletions,etc.) performed by the users of the on-demand database service 302.

Given such data, the slave servers 306 and the master server 308 storethe same on the database server 310 for the purpose of identifying adifference between the data, utilizing the aforementioned datastructure. For example, a subset of the data that is visible toparticular users of interest may be identified, using the datastructure. To this end, the aforementioned difference may be determinedwith respect to the appropriate data.

Once such difference is identified, the first servers 304 and theon-demand database service 302 may be synchronized, as appropriate. Bybuffering the on-demand database service 302 with the master server 308,a scaleable number of slave servers 306, etc., the system 300 mayprevent the on-demand database service 302 from being overrun by thefirst servers 304, in one embodiment. More information will now be setforth regarding exemplary functionality of the foregoing components inthe context of different embodiments illustrated in subsequent figures.

FIG. 4 illustrates a method 400 for initiating the synchronization of aserver and an on-demand database service, in accordance with anotherembodiment. As an option, the present method 400 may be used carried outin the context of the architecture and/or functionality of FIGS. 1-3.For example, the method 400 may represent functionality of a masterserver (e.g. the master server 308 of FIG. 3). Of course, however, themethod 400 may be carried out in any desired environment. Again, theaforementioned definitions may apply during the present description.

As shown, an on-demand database service (e.g. the on-demand databaseservice 302 of FIG. 3) may be queried. See operation 402. Such query maybe initiated in response to the receipt of a request to update the dataof one or more users of the on-demand database service, forsynchronization purposes.

In response to such query, configuration data is sent from the on-demanddatabase service to a master server (e.g. the master server 308). Noteoperation 404. Such configuration data may be stored by the on-demanddatabase service and include various policies, rules, etc. that govern adesired synchronization process.

In one embodiment, such configuration data may be user configurable andthus be different on a user-to-user basis. Just by way of example, theconfiguration data may indicate which users are to be subjected to asynchronization, user-specific synchronization profiles for each user,field maps indicating which fields on the on-demand database service areto be mapped to which fields on another server (e.g. the first server(s)304), etc. To this end, the master server may use the configuration datato configure the synchronization process to follow.

Next, any data changes (indicated by the configuration data) are loadedfrom the on-demand database service to a synchronization database server(e.g. the database server 310). See operation 406. In one embodiment,this may be accomplished by copying a plurality of data tables from theon-demand database service to the master server which, in turn,communicates the same to the synchronization database server. As anoption, the present operation 406 may be repeated periodically and/oron-demand, so that the synchronization database server has up-to-datedata changes from the on-demand database service.

Finally, a slave server process is initiated, as indicated in operation408. Such slave server process may work to prepare one or more slaveservers (e.g. the slave server 306) for interfacing with one or moreservers to be synchronized with the on-demand database service.

FIG. 5 illustrates a method 500 for preparing a slave server for asynchronization process, in accordance with another embodiment. As anoption, the present method 500 may be used carried out in the context ofthe architecture and/or functionality of FIGS. 1-4. For example, themethod 500 may represent functionality of a slave server (e.g. one ormore of the slave servers 306 of FIG. 3). Of course, however, the method500 may be carried out in any desired environment. Again, theaforementioned definitions may apply during the present description.

As shown, configuration data is loaded on a slave server (e.g. one ormore of the slave servers 306 of FIG. 3). Note operation 502. In oneembodiment, such configuration data may be stored at an on-demanddatabase service (e.g. the on-demand database service 302) and mayinclude the same or similar configuration data mentioned above inoperation 404 of FIG. 4. To this end, similar to the configuration ofthe master server, each slave server may configure itself in accordancewith the configuration data.

Next, in operation 504, the users may be provisioned across each of theslave servers. In one embodiment, this may be carried out in accordancewith the aforementioned allocation. To this end, each slave server maybe responsible for only synchronizing data changes associated with theassociated group of users.

Thus, each of the slave servers may be allocated to a different subsetof the users. Table 1 illustrates an exemplary allocation. Of course,such allocation is set forth for illustrative purposes only and shouldnot be construed as limiting in any manner whatsoever.

TABLE 1 Slave_server_1 Users_1-150 Slave_server_2 Users_151-350Slave_server_3 Users_351-400 Slave_server_4 Users_401-750

With such provisioning in place, each of the slave servers may load thechanges to data corresponding with the specific allocated users into asynchronization database server (e.g. the database server 310). Noteoperation 506.

In one embodiment, this may be accomplished by reviewing each of aplurality of records that require synchronization. For example, it mayfirst be determined whether the record was the subject of a change,update, deletion, or was just created. Based on such determination, thedata change may be temporarily stored in a separate pending table (e.g.a change table, an update table, a deletion table, a creation table,etc.).

If a particular record was the subject of a change, a process may beperformed to identify any duplication of such record in the databaseserver. For example, if a master server (e.g. in the method 500 of FIG.5) copied such record from the on-demand database service due to achange made by such service, such record may be deemed to beduplicative. In such case, the changes to the record may be merged intoa single record.

If, on the other hand, the record from the first server(s) was thesubject of an update, deletion, etc., an entry may be stored in thedatabase server in an associated update table, deletion table, etc., forreasons that will soon become apparent. In any case, the presentoperation 506 may be repeated periodically and/or on-demand, so that thesynchronization database server has up-to-date data changes from thefirst server(s).

FIG. 6 illustrates a method 600 for synchronizing an on-demand databaseservice, in accordance with another embodiment. As an option, thepresent method 600 may be used carried out in the context of thearchitecture and/or functionality of FIGS. 1-5. For example, the method600 may represent functionality of a synchronization database server(e.g. the database server 310 of FIG. 3). Of course, however, the method600 may be carried out in any desired environment. Again, theaforementioned definitions may apply during the present description.

During operation of the method 600, it may be assumed that a databaseserver (e.g. the database server 310) is supplied with up-to-date datachanges made at a first server (e.g. the first server(s) 304) as well asany data changes made at an on-demand database service (e.g. theon-demand database service 302). This may, for example, be accomplishedutilizing master/slave servers, as indicated in FIGS. 4-5.

As shown, in operation 602, a request is received to update data of atleast one of a plurality of users, for synchronization purposes. Itshould be noted that such update request may be for an update of theon-demand database service. Next, a subset of the data that isaccessible to the at least one user is identified, utilizing a datastructure. See operation 604.

In one embodiment, such data structure may include the data structure200 of FIG. 2. For example, the users associated with the update requestmay first be identified, and then corresponding user identifiers (e.g.user identifiers 202, etc.) may be used to identify the correspondingdata subset (e.g. using data identifiers 204, etc.). By this design, anupdate may be limited to the appropriate portion of the data stored bythe associated database system.

Next, a current state of the data subset is compared with a previousstate of the data subset. See operation 606. To this end, a differencemay thus be identified. Such comparison may be performed in any desiredmanner. For example, the appropriate portion of data (relevant to theproper users) may be identified utilizing the pending tables (e.g.change table, deletion table, etc.) loaded in operation 506. Further,once any changes to the appropriate subset of data are identified, therelevant fields may be updated in the on-demand database service.

To this end, the subset of the data may be updated according to thedifference. Note operation 608. It should be noted that this may beaccomplished in any desired manner. For example, in one embodiment, themethod 600 may rely on a mapping table which maps fields of the firstserver(s) with those of the on-demand database service. To this end, anyidentified changes made to certain fields in the first server(s) may bepropagated to the corresponding mapped fields of the on-demand databaseservice. As an option, such propagation may be throttled (e.g. using themaster server and any associated configuration data, etc.) to preventthe on-demand database service from being overrun.

System Overview

FIG. 7 illustrates a block diagram of an environment 710 wherein anon-demand database service might be used. As an option, any of thepreviously described embodiments of the foregoing figures may or may notbe implemented in the context of the environment 710.

Environment 710 may include user systems 712, network 714, system 716,processor system 717, application platform 718, network interface 720,tenant data storage 722, system data storage 724, program code 726, andprocess space 728. In other embodiments, environment 710 may not haveall of the components listed and/or may have other elements instead of,or in addition to, those listed above.

Environment 710 is an environment in which an on-demand database serviceexists. User system 712 may be any machine or system that is used by auser to access a database user system. For example, any of user systems712 can be a handheld computing device, a mobile phone, a laptopcomputer, a work station, and/or a network of computing devices. Asillustrated in FIG. 7 (and in more detail in FIG. 8) user systems 712might interact via a network 714 with an on-demand database service,which is system 716.

An on-demand database service, such as system 716, is a database systemthat is made available to outside users that do not need to necessarilybe concerned with building and/or maintaining the database system, butinstead may be available for their use when the users need the databasesystem (e.g., on the demand of the users). Some on-demand databaseservices may store information from one or more tenants stored intotables of a common database image to form a multi-tenant database system(MTS). Accordingly, “on-demand database service 716” and “system 716”will be used interchangeably herein. A database image may include one ormore database objects. A relational database management system (RDMS) orthe equivalent may execute storage and retrieval of information againstthe database object(s). Application platform 718 may be a framework thatallows the applications of system 716 to run, such as the hardwareand/or software, e.g., the operating system. In an embodiment, on-demanddatabase service 716 may include an application platform 718 thatenables creation, managing and executing one or more applicationsdeveloped by the provider of the on-demand database service, usersaccessing the on-demand database service via user systems 712, or thirdparty application developers accessing the on-demand database servicevia user systems 712.

The users of user systems 712 may differ in their respective capacities,and the capacity of a particular user system 712 might be entirelydetermined by permissions (permission levels) for the current user. Forexample, where a salesperson is using a particular user system 712 tointeract with system 716, that user system has the capacities allottedto that salesperson. However, while an administrator is using that usersystem to interact with system 716, that user system has the capacitiesallotted to that administrator. In systems with a hierarchical rolemodel, users at one permission level may have access to applications,data, and database information accessible by a lower permission leveluser, but may not have access to certain applications, databaseinformation, and data accessible by a user at a higher permission level.Thus, different users will have different capabilities with regard toaccessing and modifying application and database information, dependingon a user's security or permission level.

Network 714 is any network or combination of networks of devices thatcommunicate with one another. For example, network 714 can be any one orany combination of a LAN (local area network), WAN (wide area network),telephone network, wireless network, point-to-point network, starnetwork, token ring network, hub network, or other appropriateconfiguration. As the most common type of computer network in currentuse is a TCP/IP (Transfer Control Protocol and Internet Protocol)network, such as the global internetwork of networks often referred toas the “Internet” with a capital “I,” that network will be used in manyof the examples herein. However, it should be understood that thenetworks that the present invention might use are not so limited,although TCP/IP is a frequently implemented protocol.

User systems 712 might communicate with system 716 using TCP/IP and, ata higher network level, use other common Internet protocols tocommunicate, such as HTTP, FTP, AFS, WAP, etc. In an example where HTTPis used, user system 712 might include an HTTP client commonly referredto as a “browser” for sending and receiving HTTP messages to and from anHTTP server at system 716. Such an HTTP server might be implemented asthe sole network interface between system 716 and network 714, but othertechniques might be used as well or instead. In some implementations,the interface between system 716 and network 714 includes load sharingfunctionality, such as round-robin HTTP request distributors to balanceloads and distribute incoming HTTP requests evenly over a plurality ofservers. At least as for the users that are accessing that server, eachof the plurality of servers has access to the MTS' data; however, otheralternative configurations may be used instead.

In one embodiment, system 716, shown in FIG. 7, implements a web-basedcustomer relationship management (CRM) system. For example, in oneembodiment, system 716 includes application servers configured toimplement and execute CRM software applications as well as providerelated data, code, forms, webpages and other information to and fromuser systems 712 and to store to, and retrieve from, a database systemrelated data, objects, and Webpage content. With a multi-tenant system,data for multiple tenants may be stored in the same physical databaseobject, however, tenant data typically is arranged so that data of onetenant is kept logically separate from that of other tenants so that onetenant does not have access to another tenant's data, unless such datais expressly shared. In certain embodiments, system 716 implementsapplications other than, or in addition to, a CRM application. Forexample, system 716 may provide tenant access to multiple hosted(standard and custom) applications, including a CRM application. User(or third party developer) applications, which may or may not includeCRM, may be supported by the application platform 718, which managescreation, storage of the applications into one or more database objectsand executing of the applications in a virtual machine in the processspace of the system 716.

One arrangement for elements of system 716 is shown in FIG. 8, includinga network interface 720, application platform 718, tenant data storage722 for tenant data 723, system data storage 724 for system data 725accessible to system 716 and possibly multiple tenants, program code 726for implementing various functions of system 716, and a process space728 for executing MTS system processes and tenant-specific processes,such as running applications as part of an application hosting service.Additional processes that may execute on system 716 include databaseindexing processes.

Several elements in the system shown in FIG. 7 include conventional,well-known elements that are explained only briefly here. For example,each user system 712 could include a desktop personal computer,workstation, laptop, PDA, cell phone, or any wireless access protocol(WAP) enabled device or any other computing device capable ofinterfacing directly or indirectly to the Internet or other networkconnection. User system 712 typically runs an HTTP client, e.g., abrowsing program, such as Microsoft's Internet Explorer browser,Netscape's Navigator browser, Opera's browser, or a WAP-enabled browserin the case of a cell phone, PDA or other wireless device, or the like,allowing a user (e.g., subscriber of the multi-tenant database system)of user system 712 to access, process and view information, pages andapplications available to it from system 716 over network 714. Each usersystem 712 also typically includes one or more user interface devices,such as a keyboard, a mouse, trackball, touch pad, touch screen, pen orthe like, for interacting with a graphical user interface (GUI) providedby the browser on a display (e.g., a monitor screen, LCD display, etc.)in conjunction with pages, forms, applications and other informationprovided by system 716 or other systems or servers. For example, theuser interface device can be used to access data and applications hostedby system 716, and to perform searches on stored data, and otherwiseallow a user to interact with various GUI pages that may be presented toa user. As discussed above, embodiments are suitable for use with theInternet, which refers to a specific global internetwork of networks.However, it should be understood that other networks can be used insteadof the Internet, such as an intranet, an extranet, a virtual privatenetwork (VPN), a non-TCP/IP based network, any LAN or WAN or the like.

According to one embodiment, each user system 712 and all of itscomponents are operator configurable using applications, such as abrowser, including computer code run using a central processing unitsuch as an Intel Pentium® processor or the like. Similarly, system 716(and additional instances of an MTS, where more than one is present) andall of their components might be operator configurable usingapplication(s) including computer code to run using a central processingunit such as processor system 717, which may include an Intel Pentium®processor or the like, and/or multiple processor units. A computerprogram product embodiment includes a machine-readable storage medium(media) having instructions stored thereon/in which can be used toprogram a computer to perform any of the processes of the embodimentsdescribed herein. Computer code for operating and configuring system 716to intercommunicate and to process webpages, applications and other dataand media content as described herein are preferably downloaded andstored on a hard disk, but the entire program code, or portions thereof,may also be stored in any other volatile or non-volatile memory mediumor device as is well known, such as a ROM or RAM, or provided on anymedia capable of storing program code, such as any type of rotatingmedia including floppy disks, optical discs, digital versatile disk(DVD), compact disk (CD), microdrive, and magneto-optical disks, andmagnetic or optical cards, nanosystems (including molecular memory ICs),or any type of media or device suitable for storing instructions and/ordata. Additionally, the entire program code, or portions thereof, may betransmitted and downloaded from a software source over a transmissionmedium, e.g., over the Internet, or from another server, as is wellknown, or transmitted over any other conventional network connection asis well known (e.g., extranet, VPN, LAN, etc.) using any communicationmedium and protocols (e.g., TCP/IP, HTTP, HTTPS, Ethernet, etc.) as arewell known. It will also be appreciated that computer code forimplementing embodiments of the present invention can be implemented inany programming language that can be executed on a client system and/orserver or server system such as, for example, C, C++, HTML, any othermarkup language, Java™, JavaScript, ActiveX, any other scriptinglanguage, such as VBScript, and many other programming languages as arewell known may be used. (Java™ is a trademark of Sun Microsystems,Inc.).

According to one embodiment, each system 716 is configured to providewebpages, forms, applications, data and media content to user (client)systems 712 to support the access by user systems 712 as tenants ofsystem 716. As such, system 716 provides security mechanisms to keepeach tenant's data separate unless the data is shared. If more than oneMTS is used, they may be located in close proximity to one another(erg., in a server farm located in a single building or campus), or theymay be distributed at locations remote from one another (e.g., one ormore servers located in city A and one or more servers located in cityB). As used herein, each MTS could include one or more logically and/orphysically connected servers distributed locally or across one or moregeographic locations. Additionally, the term “server” is meant toinclude a computer system, including processing hardware and processspace(s), and an associated storage system and database application(e.g., OODBMS or RDBMS) as is well known in the art. It should also beunderstood that “server system” and “server” are often usedinterchangeably herein. Similarly, the database object described hereincan be implemented as single databases, a distributed database, acollection of distributed databases, a database with redundant online oroffline backups or other redundancies, etc., and might include adistributed database or storage network and associated processingintelligence.

FIG. 8 also illustrates environment 710. However, in FIG. 8 elements ofsystem 716 and various interconnections in an embodiment are furtherillustrated. FIG. 8 shows that user system 712 may include processorsystem 712A, memory system 712B, in put system 712C, and output system712D. FIG. 8 shows network 714 and system 716. FIG. 8 also shows thatsystem 716 may include tenant data storage 722, tenant data 723, systemdata storage 724, system data 725, User Interface (UI) 830, ApplicationProgram Interface (API) 832, PL/SOQL 834, save routines 836, applicationsetup mechanism 838, applications servers 800 ₁-800 _(N), system processspace 802, tenant process spaces 804, tenant management process space810, tenant storage area 812, user storage 814, and application metadata816. In other embodiments, environment 710 may not have the sameelements as those listed above and/or may have other elements insteadof, or in addition to, those listed above.

User system 712, network 714, system 716, tenant data storage 722, andsystem data storage 724 were discussed above in FIG. 7. Regarding usersystem 712, processor system 712A may be any combination of one or moreprocessors. Memory system 712B may be any combination of one or morememory devices, short term, and/or long tern memory. Input system 712Cmay be any combination of input devices, such as one or more keyboards,mice, trackballs, scanners, cameras, and/or interfaces to networks.Output system 712D may be any combination of output devices, such as oneor more monitors, printers, and/or interfaces to networks. As shown byFIG. 8, system 716 may include a network interface 720 (of FIG. 7)implemented as a set of HTTP application servers 800, an applicationplatform 718, tenant data storage 722, and system data storage 724. Alsoshown is system process space 802, including individual tenant processspaces 804 and a tenant management process space 810. Each applicationserver 800 may be configured to tenant data storage 722 and tile tenantdata 723 therein, and system data storage 724 and the system data 725therein to serve requests of user systems 712. The tenant data 723 mightbe divided into individual tenant storage areas 812, which can be eithera physical arrangement and/or a logical arrangement of data. Within eachtenant storage area 812, user storage 814 and application metadata 816might be similarly allocated for each user. For example, a copy of auser's most recently used (MRU) items might be stored to user storage814. Similarly, a copy of MRU items for an entire organization that is atenant might be stored to tenant storage area 8.12. A UI 830 provides auser interface and an API 832 provides an application programmerinterface to system 716 resident processes to users and/or developers atuser systems 712. The tenant data and the system data may be stored invarious databases, such as one or more Oracle™ databases.

Application platform 718 includes an application setup mechanism 838that supports application developers' creation and management ofapplications, which may be saved as metadata into tenant data storage722 by save routines 836 for execution by subscribers as one or moretenant process spaces 804 managed by tenant management process 810 forexample. Invocations to such applications may be coded using PL/SOQL 34that provides a programming language style interface extension to API832. A detailed description of some PL/SOQL language embodiments isdiscussed in commonly owned co-pending U.S. Provisional PatentApplication 60/828,192 entitled, PROGRAMMING LANGUAGE METHOD AND SYSTEMFOR EXTENDING APIS TO EXECUTE IN CONJUNCTION WITH DATABASE APIS, byCraig Weissman, filed Oct. 4, 2006, which is incorporated in itsentirety herein for all purposes. Invocations to applications may bedetected by one or more system processes, which manages retrievingapplication metadata 816 for the subscriber making the invocation andexecuting the metadata as an application in a virtual machine.

Each application server 800 may be communicably coupled to databasesystems, e.g., having access to system data 725 and tenant data 723, viaa different network connection. For example, one application server 800₁ might be coupled via the network 714 (e.g., the Internet), anotherapplication server 800 _(N-1) might be coupled via a direct networklink, and another application server 800 _(N) might be coupled by yet adifferent network connection. Transfer Control Protocol and InternetProtocol (TCP/IP) are typical protocols for communicating betweenapplication servers 800 and the database system. However, it will beapparent to one skilled in the art that other transport protocols may beused to optimize the system depending on the network interconnect used.

In certain embodiments, each application server 800 is configured tohandle requests for any user associated with any organization that is atenant. Because it is desirable to be able to add and remove applicationservers from the server pool at any time for any reason, there ispreferably no server affinity for a user and/or organization to aspecific application server 800. In one embodiment, therefore, aninterface system implementing a load balancing function (e.g., an F5Big-IP load balancer) is communicably coupled between the applicationservers 800 and the user systems 712 to distribute requests to theapplication servers 800. In one embodiment, the load balancer uses aleast connections algorithm to route user requests to the applicationservers 800. Other examples of load balancing algorithms, such as roundrobin and observed response time, also can be used. For example, incertain embodiments, three consecutive requests from the same user couldhit three different application servers 800, and three requests fromdifferent users could hit the same application server 800. In thismanner, system 716 is multi-tenant, wherein system 716 handles storageof, and access to, different objects, data and applications acrossdisparate users and organizations.

As an example of storage, one tenant might be a company that employs asales force where each salesperson uses system 716 to manage their salesprocess. Thus, a user might maintain contact data, leads data, customerfollow-up data, performance data, goals and progress data, etc., allapplicable to that user's personal sales process (e.g., in tenant datastorage 722). In an example of a MTS arrangement, since all of the dataand the applications to access, view, modify, report, transmit,calculate, etc., can be maintained and accessed by a user system havingnothing more than network access, the user can manage his or her salesefforts and cycles from any of many different user systems. For example,if a salesperson is visiting a customer and the customer has Internetaccess in their lobby, the salesperson can obtain critical updates as tothat customer while waiting for the customer to arrive in the lobby.

While each user's data might be separate from other users' dataregardless of the employers of each user, some data might beorganization-wide data shared or accessible by a plurality of users orall of the users for a given organization that is a tenant. Thus, theremight be some data structures managed by system 716 that are allocatedat the tenant level while other data structures might be managed at theuser level. Because an MTS might support multiple tenants includingpossible competitors, the MTS should have security protocols that keepdata, applications, and application use separate. Also, because manytenants may opt for access to an MTS rather than maintain their ownsystem, redundancy, Lip-time, and backup are additional functions thatmay be implemented in the MTS. In addition to user-specific data andtenant-specific data, system 716 might also maintain system level datausable by multiple tenants or other data. Such system level data mightinclude industry reports, news, postings, and the like that are sharableamong tenants.

In certain embodiments, user systems 712 (which may be client systems)communicate with application servers 800 to request and updatesystem-level and tenant-level data from system 716 that may requiresending one or more queries to tenant data storage 722 and/or systemdata storage 724. System 716 (e.g., an application server 800 in system716) automatically generates one or more SQL statements (e.g., one ormore SQL queries) that are designed to access the desired information.System data storage 724 may generate query plans to access the requesteddata from the database.

Each database can generally be viewed as a collection of objects, suchas a set of logical tables, containing data fitted into predefinedcategories. A “table” is one representation of a data object, and may beused herein to simplify the conceptual description of objects and customobjects according to the present invention. It should be understood that“table” and “object” may be used interchangeably herein. Each tablegenerally contains one or more data categories logically arranged ascolumns or fields in a viewable schema. Each row or record of a tablecontains an instance of data for each category defined by the fields.For example, a CRM database may include a table that describes acustomer with fields for basic contact information such as name,address, phone number, fax number, etc. Another table might describe apurchase order, including fields for information such as customer,product, sale price, date, etc. In some multi-tenant database systems,standard entity tables might be provided for use by all tenants. For CRMdatabase applications, such standard entities might include tables forAccount, Contact, Lead, and Opportunity data, each containingpre-defined fields. It should be understood that the word “entity” mayalso be used interchangeably herein with “object” and “table”.

In some multi-tenant database systems, tenants may be allowed to createand store custom objects, or they may be allowed to customize standardentities or objects, for example by creating custom fields for standardobjects, including custom index fields. U.S. patent application Ser. No.10/817,161, filed Apr. 2, 2004, entitled “Custom Entities and Fields ina Multi-Tenant Database System”, and which is hereby incorporated hereinby reference, teaches systems and methods for creating custom objects aswell as customizing standard objects in a multi-tenant database system.In certain embodiments, for example, all custom entity data rows arestored in a single multi-tenant physical table, which may containmultiple logical tables per organization. It is transparent to customersthat their multiple “tables” are in fact stored in one large table orthat their data may be stored in the same table as die data of othercustomers.

While the invention has been described by way of example and in terms ofthe specific embodiments, it is to be understood that the invention isnot limited to the disclosed embodiments. To the contrary, it isintended to cover various modifications and similar arrangements aswould be apparent to those skilled in the art. Therefore, the scope ofthe appended claims should be accorded the broadest interpretation so asto encompass all such modifications and similar arrangements.

1. A method, comprising: determining a difference between data stored ona first server and by an on-demand database service utilizing a datastructure stored on a computer readable medium, the data structureincluding a plurality of user identifiers each identifying one of aplurality of users of the on-demand database service and a plurality ofdata identifiers each correlated with at least one of the useridentifiers, the data identifiers for identifying data accessible to theuser associated with the correlated user identifier; and synchronizingthe first server and the on-demand database service, based on thedifference; wherein the on-demand database service includes anapplication platform that enables creation, management and execution ofone or more applications that are developed by at least one of: aprovider of the on-demand database service, users accessing theon-demand database service via user systems, and third party applicationdevelopers accessing the on-demand database service via the usersystems; wherein the first server communicates data to at least onesecond server; wherein the on-demand database service communicates datato a third server; wherein the at least one second server includes atleast one slave server, and the third server includes a master server;wherein in response to receipt of a request to update data of at leastone of the plurality of users, configuration data is sent from theon-demand database service to the master server, the configuration dataincluding rules utilized for configuring the synchronizing of the firstserver and the on-demand database service; wherein the configurationdata indicates at least one of the plurality of users that is subjectedto the synchronizing of the first server and the on-demand databaseservice, user-specific synchronization profiles for each of the at leastone of the plurality of users, and field maps indicating specific fieldson the on-demand database service that are mapped to specific fields onanother server.
 2. A method of claim 1, wherein a plurality of thesecond servers are in communication with the at least one first server.3. A method of claim 2, wherein each of the second servers is allocatedto a different subset of the users.
 4. A method of claim 1, wherein theat least one second server and the third server each communicate with adatabase server.
 5. A method of claim 4, wherein the database server iscoupled between the at least one second server and the third server. 6.A method of claim 4, wherein the computer readable medium is a componentof the database server.
 7. A method of claim 1, wherein the first serverand the second server communicate utilizing a collaborative authoringprotocol.
 8. A method of claim 1, wherein the third server and theon-demand database service communicate utilizing a web service.
 9. Amethod of claim 1, wherein the difference is determined in response toreceiving a request to update the data of at least one of the users. 10.A method of claim 9, wherein the difference is determined by identifyinga subset of the data that is accessible to the at least one user,utilizing the data structure.
 11. A method of claim 10, wherein thedifference is further determined by comparing a current state of thedata subset with a previous state of the data subset.
 12. A method ofclaim 1, wherein the data structure includes a first table.
 13. A methodof claim 12, wherein a second table includes the data identifiers eachcorrelated with corresponding data.
 14. A method of claim 13, whereinthe second table is used in conjunction with the first table foraccessing the data using the user identifiers.
 15. A method of claim 1,wherein the first server includes a user-level sharing entity.
 16. Amethod of claim 1, wherein the on-demand database service includes amulti-tenant database system.
 17. The method of claim 1, wherein themaster server conditionally disables the at least one slave server. 18.A computer program product embodied on a machine-readable medium,carrying one or more sequences of instructions which, when executed byone or more processors, cause the one or more processors to carry outthe steps of: determining a difference between data stored on a firstserver and by an on-demand database service utilizing a data structurestored on a computer readable medium, the data structure including aplurality of user identifiers each identifying one of a plurality ofusers of the on-demand database service and a plurality of dataidentifiers each correlated with at least one of the user identifiers,the data identifiers for identifying data accessible to the userassociated with the correlated user identifier; and synchronizing thefirst server and the on-demand database service, based on thedifference; wherein the on-demand database service includes anapplication platform that enables creation, management and execution ofone or more applications that are developed by at least one of: aprovider of the on-demand database service, users accessing theon-demand database service via user systems, and third party applicationdevelopers accessing the on-demand database service via the usersystems; wherein the first server communicates data to at least onesecond server; wherein the on-demand database service communicates datato a third server; wherein the at least one second server includes atleast one slave server, and the third server includes a master server;wherein in response to receipt of a request to update data of at leastone of the plurality of users, the computer program product operates tosend configuration data from the on-demand database service to themaster server, the configuration data including rules utilized forconfiguring the synchronizing of the first server and the on-demanddatabase service; wherein the configuration data indicates at least oneof the plurality of users that is subjected to the synchronizing of thefirst server and the on-demand database service, user-specificsynchronization profiles for each of the at least one of the pluralityof users, and field maps indicating specific fields on the on-demanddatabase service that are mapped to specific fields on another server.19. An apparatus, comprising: a processor; and one or more storedsequences of instructions which, when executed by the processor, causethe processor to carry out the steps of: determining a differencebetween data stored on a first server and by an on-demand databaseservice utilizing a data structure stored on a computer readable medium,the data structure including a plurality of user identifiers eachidentifying one of a plurality of users of the on-demand databaseservice and a plurality of data identifiers each correlated with atleast one of the user identifiers, the data identifiers for identifyingdata accessible to the user associated with the correlated useridentifier; and synchronizing the first server and the on-demanddatabase service, based on the difference; wherein the on-demanddatabase service includes an application platform that enables creation,management and execution of one or more applications that are developedby at least one of: a provider of the on-demand database service, usersaccessing the on-demand database service via user systems, and thirdparty application developers accessing the on-demand database servicevia the user systems; wherein the first server communicates data to atleast one second server; wherein the on-demand database servicecommunicates data to a third server; wherein the at least one secondserver includes at least one slave server, and the third server includesa master server; wherein in response to receipt of a request to updatedata of at least one of the plurality of users, the apparatus operatesto send configuration data from the on-demand database service to themaster server, the configuration data including rules utilized forconfiguring the synchronizing of the first server and the on-demanddatabase service; wherein the configuration data indicates at least oneof the plurality of users that is subjected to the synchronizing of thefirst server and the on-demand database service, user-specificsynchronization profiles for each of the at least one of the pluralityof users, and field maps indicating specific fields on the on-demanddatabase service that are mapped to specific fields on another server.20. A data structure embodied on a computer readable medium, comprising:a plurality of user identifier objects, each of the user identifierobjects identifying one of a plurality of users of an on-demand databaseservice; a plurality of data identifier objects, each of the dataidentifier objects correlated with at least one of the user identifierobjects, and each of the data identifier objects for identifying dataaccessible to the user associated with the correlated user identifierobject; and logic, carrying one or more sequences of instructions, whichwhen executed by one or more processors, cause the one or moreprocessors to synchronize a server and the on-demand database serviceutilizing the user identifier objects and the data identifier objects;wherein the on-demand database service includes an application platformthat enables creation, management and execution of one or moreapplications that are developed by at least one of: a provider of theon-demand database service, users accessing the on-demand databaseservice via user systems, and third party application developersaccessing the on-demand database service via the user systems; whereinthe data structure is utilized whereby the first server communicatesdata to at least one second server; wherein the data structure isutilized whereby the on-demand database service communicates data to athird server; wherein the data structure is utilized whereby the atleast one second server includes at least one slave server, and thethird server includes a master server; wherein in response to receipt ofa request to update data of at least one of the plurality of users, thedata structure is utilized whereby configuration data is sent from theon-demand database service to the master server, the configuration dataincluding rules utilized for configuring the synchronizing of the firstserver and the on-demand database service; wherein the configurationdata indicates at least one of the plurality of users that is subjectedto the synchronizing of the first server and the on-demand databaseservice, user-specific synchronization profiles for each of the at leastone of the plurality of users, and field maps indicating specific fieldson the on-demand database service that are mapped to specific fields onanother server.
 21. A system, comprising: a first server; a secondserver coupled to the first server; a third server coupled to anon-demand database service; and a database server coupled to the secondserver and the third server, the database server for determining adifference between data stored on the first server and by the on-demanddatabase service, and synchronizing the first server and the on-demanddatabase service based on the difference; wherein the on-demand databaseservice includes an application platform that enables creation,management and execution of one or more applications that are developedby at least one of: a provider of the on-demand database service, usersaccessing the on-demand database service via user systems, and thirdparty application developers accessing the on-demand database servicevia the user systems; wherein the first server communicates data to thesecond server; wherein the on-demand database service communicates datato the third server; wherein the second server includes at least oneslave server, and the third server includes a master server; wherein inresponse to receipt of a request to update data of at least one of theplurality of users, the system operates to send configuration data fromthe on-demand database service to the master server, the configurationdata including rules utilized for configuring the synchronizing of thefirst server and the on-demand database service; wherein theconfiguration data indicates at least one of the plurality of users thatis subjected to the synchronizing of the first server and the on-demanddatabase service, user-specific synchronization profiles for each of theat least one of the plurality of users, and field maps indicatingspecific fields on the on-demand database service that are mapped tospecific fields on another server.